package com.ruoyi.shop.common.core.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.common.core.mapper.ShopRegionMapper;
import com.ruoyi.shop.common.core.domain.ShopRegion;
import com.ruoyi.shop.common.core.service.IShopRegionService;
import com.ruoyi.common.core.text.Convert;

/**
 * 行政地区Service业务层处理
 * 
 * @author xuxiang
 * @date 2022-10-17
 */
@Service
public class ShopRegionServiceImpl implements IShopRegionService 
{
    @Autowired
    private ShopRegionMapper shopRegionMapper;

    /**
     * 查询行政地区
     * 
     * @param regionId 行政地区主键
     * @return 行政地区
     */
    @Override
    public ShopRegion selectRegionById(Long regionId)
    {
        return shopRegionMapper.selectRegionById(regionId);
    }

    /**
     * 查询行政地区列表
     * 
     * @param shopRegion 行政地区
     * @return 行政地区
     */
    @Override
    public List<ShopRegion> selectRegionList(ShopRegion shopRegion)
    {
        return shopRegionMapper.selectRegionList(shopRegion);
    }

    /**
     * 新增行政地区
     * 
     * @param shopRegion 行政地区
     * @return 结果
     */
    @Override
    public int insertRegion(ShopRegion shopRegion)
    {
        return shopRegionMapper.insertRegion(shopRegion);
    }

    /**
     * 修改行政地区
     * 
     * @param shopRegion 行政地区
     * @return 结果
     */
    @Override
    public int updateRegion(ShopRegion shopRegion)
    {
        return shopRegionMapper.updateRegion(shopRegion);
    }

    /**
     * 批量删除行政地区
     * 
     * @param regionIds 需要删除的行政地区主键
     * @return 结果
     */
    @Override
    public int deleteRegionByIds(String regionIds)
    {
        return shopRegionMapper.deleteRegionByIds(Convert.toStrArray(regionIds));
    }

	/**
	 * 删除行政地区信息
	 * 
	 * @param regionId 行政地区主键
	 * @return 结果
	 */
	@Override
	public int deleteRegionById(Long regionId) {
		return shopRegionMapper.deleteRegionById(regionId);
	}
}
